
#ifndef __LINUX_TTY_DRIVER_H__
#define __LINUX_TTY_DRIVER_H__

#include "linux/fs.h"

struct tty_struct;

struct tty_operations {
  int  (*open)(struct tty_struct * tty, struct file* filp);
  void (*close)(struct tty_struct * tty, struct file* filp);
  int  (*write)(struct tty_struct * tty,
                const unsigned char *buf, int count);
  void (*put_char)(struct tty_struct *tty, unsigned char ch);
  void (*flush_chars)(struct tty_struct *tty);
  int  (*write_room)(struct tty_struct *tty);
  int  (*chars_in_buffer)(struct tty_struct *tty);
  int  (*ioctl)(struct tty_struct *tty, struct file * file,
                u32 cmd, unsigned long arg);
  void (*set_termios)(struct tty_struct *tty, struct termios * old);
  void (*throttle)(struct tty_struct * tty);
  void (*unthrottle)(struct tty_struct * tty);
  void (*stop)(struct tty_struct *tty);
  void (*start)(struct tty_struct *tty);
  void (*hangup)(struct tty_struct *tty);
  void (*break_ctl)(struct tty_struct *tty, int state);
  void (*flush_buffer)(struct tty_struct *tty);
  void (*set_ldisc)(struct tty_struct *tty);
  void (*wait_until_sent)(struct tty_struct *tty, int timeout);
  void (*send_xchar)(struct tty_struct *tty, char ch);
  int (*read_proc)(char *page, char **start, off_t off,
                   int count, int *eof, void *data);
  int (*write_proc)(struct file *file, const char __user *buffer,
                    unsigned long count, void *data);
  int (*tiocmget)(struct tty_struct *tty, struct file *file);
  int (*tiocmset)(struct tty_struct *tty, struct file *file,
                  u32 set, u32 clear);
};

#endif  // __LINUX_TTY_DRIVER_H__
